package com.blog.cloud.captcha.controller;

import com.blog.cloud.captcha.service.CaptchaService;
import com.blog.cloud.captcha.vo.CaptchaVO;
import com.blog.cloud.core.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    @Autowired
    private CaptchaService captchaService;

    @PostMapping("/generate")
    public R<CaptchaVO> generate() {
        CaptchaVO captchaVO = captchaService.generate();
        return R.ok(captchaVO);
    }

}
